#include <iostream>

using namespace std;

typedef struct _TREE_NODE
{
	int data;
	int number;
	struct _TREE_NODE* left_child;
	struct _TREE_NODE* right_child;
}TREE_NODE;

STATUS _insert_node_into_tree(TREE_NODE* pTreeNode, int data)
{
	TREE_NODE* pNode;

	while(1){
		if(data<pTreeNode->data){
			if(NULL == pTreeNode->left_child){
				pNode = create_tree_node(data);
				pNode->number = pTreeNode->number << 1;
				pTreeNode->left_child = pNode;
				break;
			}else{
				pTreeNode = pTreeNode->left_child;
			}
		}else{
			if(NULL == pTreeNode->right_child){
				pNode = create_tree_node(data);
				pNode -> number = (pTreeNode->number <<1) +1;
				pTreeNode->right_child = pNode;
				break;
			}else{
				pTreeNode = pTreeNode->right_child;
			}
		}
	}
	return TRUE;
}

STATUS insert_node_into_tree(TREE_NODE** ppTreeNode, int data)
{
	if(NULL == pTreeNode)
		return FALSE;
	if(NULL == *ppTreeNode){
		*ppTreeNode = (TREE_NODE*)create_tree_node(data);
		(*ppTreeNode)->number = 1;
		return TRUE;
	}

	return _insert_node_into_tree(*ppTreeNode,data);
}



int main()
{
    cout << "Hello world!" << endl;
    return 0;
}
